EmbedOptions

The EmbedOptions object contains details for what items should be embedded and any filter information required.

Constructors

embedOptions{contentId:string, filters?: Filter, targets?:Target[], theme?:string, onLoad?: function (content:EmbeddedResult), deviceType?: string}: EmbedOptions
  • Use this to set the details for embedding.
  • The content ID is the GUID string of the item that is to be embedded. Required.
  • Filters is the Filter object of items to drive filtering on the content. Optional.
  • Targets is the Target object of items to drive targeted filtering on the content. Optional.
  • Theme is a string to drive the theme colors of the built-in dialogs. Optional. Colors are:
    • "dark"
    • "light" (default)
  • The onLoad event function is a callback function that will be triggered once the content has been loaded and there is a result. Optional.
  • The optional device type specifies the layout type of the presentation to use. If not supplied, the device type is determined automatically. Types are:
    • "desktop"
    • "tablet"
    • "phone"

Example

The following instantiates a new filter object and attaches a filter for the year 2020 from the dates dimension. This is then attached to the an EmbedOptions object called options, which is then added to the embed method call.

var fil = Filter.create(); fil.add("dates","years","2020"); var options = {contentId:"c20d42b4-be24-47cf-b711-d5782f048590", filters: fil, theme: 'dark', onLoad: ContentLoaded} client.embed($("myContainer"), options)

When the content has loaded up, the ContentLoaded function will be called and passed the EmbeddResult object.

Any dialogs also appear with the dark theme.